package com.glodon.paas.search.model;

import java.util.Date;

import javax.ws.rs.QueryParam;

/**
 * 搜索时传入的dto对象.
 * 
 * @author botao.liao
 * 
 */
public class QueryDocument extends Document implements QueryBase {
    private static final long serialVersionUID = 1L;
    @QueryParam("createTimeFrom")
    private Date createTimeFrom;
    @QueryParam("createTimeTo")
    private Date createTimeTo;
    @QueryParam("updateTimeFrom")
    private Date updateTimeFrom;
    @QueryParam("updateTimeTo")
    private Date updateTimeTo;
    @QueryParam("from")
    private int from = 0;// 查询的其实记录
    @QueryParam("size")
    private int size = 10;// 查询返回的记录数

    public Date getCreateTimeFrom() {
        return createTimeFrom;
    }

    public void setCreateTimeFrom(Date createTimeFrom) {
        this.createTimeFrom = createTimeFrom;
    }

    public Date getCreateTimeTo() {
        return createTimeTo;
    }

    public void setCreateTimeTo(Date createTimeTo) {
        this.createTimeTo = createTimeTo;
    }

    public Date getUpdateTimeFrom() {
        return updateTimeFrom;
    }

    public void setUpdateTimeFrom(Date updateTimeFrom) {
        this.updateTimeFrom = updateTimeFrom;
    }

    public Date getUpdateTimeTo() {
        return updateTimeTo;
    }

    public void setUpdateTimeTo(Date updateTimeTo) {
        this.updateTimeTo = updateTimeTo;
    }

    public int getFrom() {
        return from;
    }

    public void setFrom(int from) {
        this.from = from;
    }

    public int getSize() {
        return size > 0 ? size : 10;
    }

    public void setSize(int size) {
        this.size = size;
    }

    @Override
    public String toString() {
        return "QueryDocument [createTimeFrom=" + createTimeFrom + ", createTimeTo=" + createTimeTo
                + ", updateTimeFrom=" + updateTimeFrom + ", updateTimeTo=" + updateTimeTo + ", from=" + from
                + ", size=" + size + ", getType()=" + getType() + ", getFileType()=" + getFileType()
                + ", getExtension()=" + getExtension() + ", getUrl()=" + getUrl() + ", getContent()=" + getContent()
                + ", getId()=" + getId() + ", getName()=" + getName() + ", getDatabagId()=" + getDatabagId()
                + ", getProjectId()=" + getProjectId() + ", getParentId()=" + getParentId() + ", getOwnerId()="
                + getOwnerId() + ", getShares()=" + getShares() + ", getVersion()=" + getVersion() + ", getPath()="
                + getPath() + "]";
    }
}
